#ifndef _MACHINE_H_
#define _MACHINE_H_
//#include "define.h"
//#include "icmp.h"
//#include "netcapture.h"
#include <map>
#include <vector>
#include <cstdlib>    
#include <string> 
#ifdef WIN32
#else
#include <unistd.h>
#endif
#include <algorithm>  

#include "NetCap.h"

class manager
{
public:
    manager ();
    ~manager ();
	int ping(const char* ip, int bfs, int timeout, int& usedtime);
	int ipDetect(string ip);
	string getMacs(unsigned int seq,std::vector<pair<uint64_t,macinfo> > &vmac);
	int getdetect(unsigned int seq,std::map<std::string ,uint64_t>&ips);
	int getlinkstat(unsigned int seq, std::vector<linkstat>&linkstats);
	int getFlows(unsigned int seq);
	int getUpFlows(unsigned int seq);
	int getDownFlows(unsigned int seq);
	void createCap(string rule,int seq);
	bool startCap(unsigned int seq);
	static void * capThreadCreate(void* param);
	void stopCap(int seq);
	unsigned int getnetflag(unsigned int seq);
	void startipdetect(int seq);
	void stopipdetect(int seq);
	//std::vector< pair<uint64_t,unsigned int> > maclist;
	std::map<unsigned int, NetCap*>caplist;
private:
    

};
#endif
